<html lang="zh-cn">

<head>
    <meta charset="UTF-8">
    <title>Settings</title>
    <script src="{{winapi}}"></script>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="{{static}}/css/settings.css">
    <script>
        WORK_DIR = "{{work_dir}}"
        API_PATH = "{{api}}"
        ROOT_PATH = "{{root}}"
        PLUGIN_DIR = "{{plugin_dir}}"
    </script>
    <script src="{{static}}/js/settings.js"></script>
</head>

<body>
    <div id="left_bar">
        <button type="button" class="bar_choose" id="ch_page_0" onclick="ch_page(0)">关于</button>
        <button type="button" onclick="ch_page(1)" id="ch_page_1">配置</button>
        <button type="button" onclick="ch_page(2)" id="ch_page_2">外观</button>
        <button type="button" onclick="ch_page(3)" id="ch_page_3" class="hide">电源</button>
        <button type="button" onclick="ch_page(4)" id="ch_page_4">用户</button>
        <button type="button" onclick="ch_page(5)" id="ch_page_5" class="hide">管理</button>
        <button type="button" onclick="ch_page(6)" id="ch_page_6" class="hide">插件</button>
    </div>
    <div id="bar_split"></div>
    <div id="cfg_page">
        <div class="page page_show" id="page_0">
            <img src="{{static}}/img/logo.png" alt="logo">
            <div id="page_0_text">
                <p>Neutron Panel</p>
                <p>Version:{{version}}</p>
                <p>
                    <button type="button" onclick="update()" class="inline_btn">更新面板</button>
                    <button type="button" onclick="open_link()" class="inline_btn">项目地址</button>
                </p>
            </div>
        </div>
        <div class="page" id="page_1">
            <div id="page_1_text">
                <p>暂不支持直接修改配置</p>
                <p>点击 <button type="button" onclick="open_cfg()" class="inline_btn">此处</button> 打开配置文件</p>
                <p><a href="https://gitee.com/cxy_kevin/neutron/blob/master/docs/configs.md" target="_blank"
                        rel="noopener">点击获取配置文档</a></p>

            </div>
        </div>
        <div class="page" id="page_2">
            <div id="page_2_wallpaper_text">桌面背景</div>
            <div id="page_2_wallpaper_demo">
                <button type="button" class="page_2_wallpaper_demos" id="page_2_wallpaper_demo_1"
                    onclick="change_bg(1)">1</button>
                <button type="button" class="page_2_wallpaper_demos" id="page_2_wallpaper_demo_2"
                    onclick="change_bg(2)">2</button>
                <button type="button" class="page_2_wallpaper_demos" id="page_2_wallpaper_demo_3"
                    onclick="change_bg(3)">3</button>
                <button type="button" class="page_2_wallpaper_demos" id="page_2_wallpaper_demo_4"
                    onclick="change_bg(4)">4</button>
                <button type="button" class="page_2_wallpaper_demos" id="page_2_wallpaper_demo_5"
                    onclick="change_bg(5)">5</button>
                <button type="button" class="page_2_wallpaper_demos" id="page_2_wallpaper_demo_6"
                    onclick="change_bg_custom()">图片</button>
            </div>
        </div>
        <div class="page" id="page_3">
            <div id="page_3_power_panel_text" class="page_3_power_panel_text">面板操作</div>
            <div class="page_3_power_panel_btn" id="page_3_power_panel_btn">
                <button type="button" class="inline_btn page_3_power_os_btns"
                    onclick="power_do('restart_panel')">重启</button>
            </div>
            <div id="page_3_power_os_text">服务器电源</div>
            <div id="page_3_power_os_btn">
                <button type="button" class="inline_btn page_3_power_os_btns"
                    onclick="power_do('shutdown_sys')">关机</button>
                <button type="button" class="inline_btn page_3_power_os_btns"
                    onclick="power_do('reboot_sys')">重启</button>
                <button type="button" class="inline_btn page_3_power_os_btns"
                    onclick="power_do('cancel_sys')">取消</button>
            </div>
        </div>
        <div class="page" id="page_4">
            <div class="page_3_power_panel_text">用户操作</div>
            <div class="page_3_power_panel_btn">
                <button type="button" class="inline_btn page_3_power_os_btns" id="page_4_change_passwd"
                    onclick="change_passwd()">更改密码</button>
                <button type="button" class="inline_btn page_3_power_os_btns" id="page_4_logout"
                    onclick="logout()">退出登录</button>
                <button type="button" class="inline_btn page_3_power_os_btns" id="page_4_clean_session"
                    onclick="clean_session()">清理会话</button>
            </div>
        </div>
        <div class="page" id="page_5">
            <div class="page_3_power_panel_text">用户管理</div><button type="button" class="inline_btn"
                id="page_5_show_all_tasks" onclick="show_all_tasks()">所有任务</button>
            <button type="button" class="inline_btn" id="page_5_add_user" onclick="create_user()">创建</button>
            <div id="page_5_users">
            </div>
        </div>
        <div class="page" id="page_6">
            <div class="page_3_power_panel_text">插件管理</div>
            <button type="button" class="inline_btn" id="page_6_add_plugin" onclick="install_plugin_btn()">安装</button>
            <button type="button" class="inline_btn" id="page_6_need_restart"
                onclick="power_do('restart_panel')">需要重启</button>
            <div id="page_6_plugins">
            </div>
        </div>
    </div>
</body>

</html>